package com.zhangtai.modules.service.contract;

import com.zhangtai.modules.entity.contract.ProtocolEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * 培训协议
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-10-21 16:30:00
 */

public interface ProtocolService {

    @GetMapping("/findProtocolList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                         @RequestParam(value = "projectName", required = false) String projectName,
                         @RequestParam(value = "startTime", required = false) String startTime,
                         @RequestParam(value = "endTime", required = false) String endTime,
                         @RequestParam(value = "trainingType", required = false) Integer trainingType,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoProtocol")
    @ApiOperation(value = "根据id查找")
    ProtocolEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveProtocol")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody ProtocolEntity entity);

    @PostMapping("/updateProtocol")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody ProtocolEntity entity);

    @GetMapping("/deleteOneProtocol")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteProtocols")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

